import com.yh.pojo.Books;
import com.yh.service.BookService;
import com.yh.service.BookServiceImpl;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Mytest {

    @Test
    public void test1(){
        ApplicationContext ac =new ClassPathXmlApplicationContext("applicationContext.xml");

        BookService bookService = ac.getBean("BookServiceImpl", BookService.class);
        for (Books books : bookService.queryAllBook()) {
            System.out.println(books);
        }
    }
}
